package com.chixing.day05.oop;

public class Overload {
    public static void main(String[] args) {
        //方法重载overload：方法名相同＋参数列表不一样
        //1.个数不一样2.类型不一样3.顺序不一样
        Math.max(10,20);
        Math.max(2.3,3.3);

        Math.abs(-10);
        Math.abs(9.32f);

        //若传过来的实参（个数）不确定
        fun();
        fun(10);
        fun(10,20);
        int[]x={11,22,33,44};
        fun(x);
    }

    public static void fun(int... a) {}
//两个数之和
    public static int add(int a,int b) {
        return 0;
    }
    //三个数之和
    public static void add(int a,int b,int c){}
    public static  int add(float a,float b){
        return 0;
    }

    public static  int add(float a){return  0;}
    public static  int add(double x){return  0;}

    public  static  void add(int x,float y){  }
    public  static  void add(float x,int y){  }

}
